
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

int main()
{
    int max, n;
    scanf("%d", &n);
    max = n;
    while (n != -1) {
        scanf("%d", &n);
        if (n != -1) {
            if (max <= n) {
                max = n;
            }
        }
    }
    printf("%d\n", max);
    return 0;
}